<%@page contentType="text/html;charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@ page session="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<html>
<head>
	<META http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>User Matrix</title>
</head>	
<body>
<br/>
<br/>


<br/>

	<table id="table-css">
	<caption>User Prediction Matrix</caption>
		<tr class='alt' >
			<td>Match No</td>
			<td>Match Summary</td>	
			<td>Match Outcome</td>
			<c:forEach var="userPool" items="${usersInPool}"  varStatus="userIndex">
				<td>${userPool.name}</td>
			</c:forEach>
		</tr>		
		<c:forEach var="matchWithPrediction" items="${matchesWithPreds}"  varStatus="index">		
		<tr <c:if test="${((index.index+1)%2)==0}">class='alt'</c:if>>
			<td>${matchWithPrediction.matchNo}</td>
			<td>${matchWithPrediction.matchSummary}</td>	
			<td>${matchWithPrediction.matchOutcome}</td>
			
			<c:forEach var="userPredictions" items="${matchWithPrediction.userPredictions}"  varStatus="userPredIndex">
				<td <c:if test="${(userPredictions.matchPrediction) eq (matchWithPrediction.matchOutcome)}">class='tdColor'</c:if> >${userPredictions.matchPrediction}</td>
			</c:forEach>
		</tr>
		</c:forEach>
	</table>	
<br/>
<br/>
<div align="center"><a href="<c:url value='/users/predictions/${userPoolId}'/>"><img src="/static/images/ChangePredictions.gif"/></a></div>
<br/>
<br/>
</body>
</html>


